package user

import (
	"context"
	"srv/config"
	"srv/internal/model/dao"
	__ "srv/proto"
	"srv/tools"
)

// 实现方法
func (s *UserService) SalesInfo(ctx context.Context, req *__.SalesInfoRequest) (resp *__.SalesInfoResponse, err error) {
	var sals dao.SaleInfo
	config.DB.Where("mobile=? or name=?", req.Mobile, req.Name).Find(&sals)
	tools.ToRedis(sals.SaleName, sals.Mobile)
	return &__.SalesInfoResponse{
		Mobile: sals.Mobile,
		Name:   sals.SaleName,
	}, nil
}
